package com.xiaoke.java1;

import java.util.ArrayList;
import java.util.List;

/**
 * 测试 MinorGC MajorGC FullGC
 *
 * -Xms9m -Xmx9m -XX:+PrintGCDetails
 *
 * @author yd
 * @version 1.0
 * @date 2022/2/21 6:42
 */
public class GCTest {

    public static void main(String[] args) {
        int i = 0;
        try {
            List<String> list = new ArrayList<>();
            String a = "xiaoke.com";
            while(true){
                list.add(a);
                a = a + a;
                i ++;
            }
        } catch (Throwable t) {
            t.printStackTrace();
            System.out.println("遍历次数为: " + i);
        }

    }


}
